XxU4
Background: Know: ASN.1 foundations, Recognize: Anticipates: tables, INDEX Sequences SEQUENCE and SEQUENCE OF are universal Constructor/structured types that generate tables and lists, respectively. Different from Primitive types (NTEGER, BOOLEAN, OCTECT STRING, OBJECT IDENTIFIER, ENUMERATED and NULL), these types might have multiple instances. Below, the universal class number (tag) of the types: Structured Types Tag Typical Use SEQUENCE 16 Models an ordered collection of variables of different type SEQUENCE OF 16 Models an ordered collection of variables of the same type SEQUENCE Defines an ordered collection of one or more types. In other words, it gives the format to each column in a table. Then, every row that belongs to the table must have the same type of values as the sequence defined. Regardless the number of elements/columns of the table, the notation of SEQUENCE according to ASN.1 is defined as follows: SEQUENCE { identifier1 Type1 OPTIONAL | DEFAULT value1}, ..., identifiern Typen OPTIONAL | DEFAULT valuen} } Where, - Identifiern Optional is used to distinct the types that will be managed in the table. Used mainly for documentation purposes and it does not affect the values of the types. - Typen Required defines the type of variable that will be managed (e.g. Integer, OctetString, etc ) - OPTIONAL | DEFAULT valuen: There are two ways to specify that a component type is optional in the ordered list: using OPTIONAL after the component type and using DEFAULT followed by a valuen after the component type. When DEFAULT is used, the specified valuen is assumed whenever the type is absent from the list. In general, a sequence with different columns/types of information could follow this flow chartt: http://people.dsv.su.se/~jpalme/internet-course/solving-asn-1-exercise.html Example Validity ::= SEQUENCE { start UTCTime, end UTCTime } In this case, each instance that belongs to the sequence must have two fields called "start" and "end" with values UTCTime Type. There are not optional types and therefore there are not default values in case of absence. SEQUENCE OF It is defined also as a collection of elements, but different from SEQUENCE, these must be of the same type. A table could be defined as a SEQUENCE OF rows. According to ASN.1 the notation is given by SEQUENCE OF Type Where, Type Required is the type of value that each element in the list must have. Example RDNSequence ::= SEQUENCE OF RelativeDistinguishedName In the example above, each element in the list must have the format of RelativeDistinguishedName type. In some circumstances, it is possible that the SEQUENCE OF rows have more than one type of information. In this case, one could define a SEQUENCE OF in terms of SEQUENCE. For instance: HeaderFields ::= SEQUENCE OF Header In this case, suppose that the header contents two types of information. Then, we could define Header in terms of a SEQUENCE, Header ::= SEQUENCE { headername, headerdata } Here, "headername" and "headerdata" have the same structure as typen in SEQUENCE , defined above. Therefore, header becomes a type defined by joining two single types. External Resources: [1 http://people.dsv.su.se/~jpalme/internet-course/solving-asn-1-exercise.html] [2 http://www.obj-sys.com/asn1tutorial/node11.html] [3 http://luca.ntop.org/Teaching/Appunti/asn1.html] [4 http://powerasn.ncottin.net/download/Introduction_To_ASN1.pdf] Category:All